<?php

namespace app\controller;

use support\Request;

class Index
{
    protected $ws_url = 'ws://124.222.175.11:3131';
    protected $api_url = 'http://124.222.175.11:8787/api/chat/';
    public function index(Request $request)
    {
        $from_id = $request->get("from_id");
        return view('index/chat_list',['from_id' => $from_id,'ws_url'=>$this->ws_url,'api_url'=>$this->api_url]);
    }

    public function chat_common(Request $request)
    {
        $from_id = $request->get("from_id");
        $to_id = $request->get("to_id");
        return view('index/chat_common',['from_id' => $from_id, 'to_id' => $to_id,'ws_url'=>$this->ws_url,'api_url'=>$this->api_url]);
    }

    public function view(Request $request)
    {
        return view('index/view', ['name' => 'webman']);
    }

    public function json(Request $request)
    {
        return json(['code' => 0, 'msg' => 'ok']);
    }

}
